<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="java.text.DateFormat"%>
<%@page import="com.ereport.entity.Opportunity"%>
<%@page import="java.util.List"%>

<link rel="stylesheet" href="<%=application.getContextPath() %>/css/jquery-ui-1.8.17.custom.css"/>
<script type="text/javascript" src="<%=application.getContextPath() %>/js/jquery-1.6.min.js"></script>
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/datatable.css"/>
<script type="text/javascript" language="javascript" src="<%=application.getContextPath()%>/js/jquery.dataTables.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/colResizable-1.3.min.js"></script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#rfqTable').dataTable({
			//"sDom": 'R<"H"lfr>t<"F"ip<',
			
			"bScrollCollapse": true,
			"bAutoWidth": true,
			"bJQueryUI": true,
			"sPaginationType": "full_numbers",
			"bSortClasses": false,
			"aaSorting": [] 
			
		});
	} );
</script>
<script type="text/javascript">
$(function(){
	  $("#rfqTable").colResizable();
	});
</script>
<style>
<!--
.ui-widget-header {
    background: url("") repeat-x scroll 50% 50% #86b4cc;
    border: 1px solid #86b4cc;
    color: #FFFFFF;
    font-weight: bold;
}
.dataTables_filter{
height: 25px;
width:210px;
}
.ui-buttonset .ui-button {
    margin-left: 0;
    margin-right: 0.001em;
}
.ui-corner-tl {
    
    font-size: 13px;
    
}
.paging_full_numbers {
    height: 22px;
    line-height: 18px;
    width: 300px;
}
.dataTables_filter input{
width:148px;
 height:20px;
  background:#ffffff;
   border-radius: 4px;
     border:1px solid #a1a1a1;
}

.tablebox {
	margin: 0px;
	padding: 0px;
	height: auto;
	width: 100%;
	border: 0px solid #DDDDDD;
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}
-->
</style>
<%
List<Opportunity> oplist=(List<Opportunity>)request.getAttribute("oplist");

if(oplist!=null){
	System.out.println(oplist.get(0).getContactName());
%>


          <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
            <tr>
              <td valign="top"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td width="100%">
                    <div id="demo">
                    <table width="100%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#787878" class="tablebox" id="rfqTable">
                        <thead>
                        <tr >
                          <th width="23" height="30" align="center" valign="middle" class="hed">Sr. No </th>
                          <th width="144" align="center" valign="middle" class="hed">Company</th>
                          <th width="91" align="center" valign="middle" class="hed">Division</th>
                          <th width="91" align="center" valign="middle" class="hed">Contact Person</th>
                          <th width="56" align="center" valign="middle" class="hed">Enquiry Type</th>
                          <th width="52" align="center" valign="middle" class="hed">Due Date</th>
                          <th width="110" align="center" valign="middle" class="hed">Project</th>
                          <th width="110" align="center" valign="middle" class="hed">Created Date</th>
                         
                      </tr>
                      </thead>
                      <tbody>
                        <%
                       
                  for(int i=0;i<oplist.size();i++){
                	  String ddate="";
                     Date dat=oplist.get(i).getDueDate();
                      DateFormat dfmt=new SimpleDateFormat("dd-MM-yyyy");
                      	ddate=dfmt.format(dat.getTime());
                      	
                	  String cdate="";
                     Date cdat=oplist.get(i).getCurrDate();
                      DateFormat cdfmt=new SimpleDateFormat("dd-MM-yyyy");
                      	cdate=cdfmt.format(cdat.getTime());
                      
                  %>
                        <tr>
                          <td align="center" bgcolor="#deeef6"><%=i+1%></td>
                          <td bgcolor="#deeef6" align="center" title="<%=oplist.get(i).getOrgName()%>">
                          <a href="<%=application.getContextPath() %>/opportunity/preEnqReport.do?dactid=<%=oplist.get(i).getDactid().getId()%>&edate=<%=cdat%>" >
                          	<span style="color: #0b395c;"><%=oplist.get(i).getOrgName()%></span>
                          </a>
                         <%--  <input type="hidden" name="dactid" value="<%=oplist.get(i).getDactid()%>"/> --%>
                          </td>
                          <td bgcolor="#deeef6" align="center" title="<%= oplist.get(i).getDivision()%>">
                         	<%= oplist.get(i).getDivision()%>
                         	
                          </td>
                          <td bgcolor="#deeef6" align="center" title="<%= oplist.get(i).getContactName()%>">
                         	<%= oplist.get(i).getContactName()%>
                         	
                          </td>
                          <td bgcolor="#deeef6" align="center" title="<%=oplist.get(i).getEnqType()%>">
                          <%= oplist.get(i).getEnqType()%> 
                          </td>
                          <td  align="center" bgcolor="#d5e9f3" title="<%=ddate%>">
                          <%= ddate%>
                          </td>
                          <td  bgcolor="#deeef6" align="center" title="<%= oplist.get(i).getProjName()%>">
                          <%= oplist.get(i).getProjName()%>
                          </td>
                          <td  bgcolor="#deeef6" align="center" title="<%=cdate%>">
                           <%= cdate%>
                           <input type="hidden" name="org" id="org" value="<%=oplist.get(i).getOrgName()%>"/>
                          </td>
            
                        </tr>
                        <%
                  			}
                        %>
                 </tbody>
                    </table>
                    </div>
                    </td>
                  </tr>
                 
              </table></td>
            </tr>
            <tr>
           		<td align="left" >&nbsp;</td>
           			
           	</tr>
             
           	<tr>
           		<td align="left" >&nbsp;</td>
           			
           	</tr>	  
                  
          </table>
          
        
   <%
	}
    %>